package com.bsoft.wx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bsoft.wx.mapper.TbFaceModelMapper;
import com.bsoft.wx.pojo.TbFaceModel;
import com.bsoft.wx.service.TbFaceModelService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hdh
 * @since 2023-01-11
 */
@Service
public class TbFaceModelServiceImpl extends ServiceImpl<TbFaceModelMapper, TbFaceModel> implements TbFaceModelService {

    @Override
    public String searchFaceMode(int UserId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("user_id", UserId);
        return baseMapper.selectById(UserId).getFaceModel();

    }

    @Override
    public void insert(TbFaceModel tbFaceModel) {

        baseMapper.insert(tbFaceModel);
    }

    @Override
    public int delectFaceMode(int userId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("user_id", userId);
        return baseMapper.delete(queryWrapper);

    }
}
